package com.zjitc.service.impl;

import com.zjitc.mapper.BookMapper;
import com.zjitc.pojo.Book;
import com.zjitc.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    @Override
    public List<Book> findAll() {
        return bookMapper.findAll();
    }

    @Override
    public boolean delete(int id) {
        return bookMapper.delete(id);
    }

    @Override
    public Book findOne(int id) {
        return bookMapper.findOne(id);
    }

    @Override
    public boolean update(Book book) {
        return bookMapper.update(book);
    }

    @Override
    public boolean insert(Book book) {
        return bookMapper.insert(book);
    }

    @Override
    public boolean borrow(int id) {
        return bookMapper.borrow(id);
    }

    @Override
    public boolean back(int id) {
        return bookMapper.back(id);
    }
}
